package xyz.lwm.lazycat.transaction.execute;

import java.sql.Connection;

/**
 * 事务隔离级别
 */
public enum Isolation {

    /**
     * 默认事务隔离级别
     */
    DEFAULT(-1),

    /**
     * 读未提交
     */
    READ_UNCOMMITTED(Connection.TRANSACTION_READ_UNCOMMITTED),

    /**
     * 读已提交
     */
    READ_COMMITTED(Connection.TRANSACTION_READ_COMMITTED),

    /**
     * 可重复读
     */
    REPEATABLE_READ(Connection.TRANSACTION_REPEATABLE_READ),

    /**
     * 串行化
     */
    SERIALIZABLE(Connection.TRANSACTION_SERIALIZABLE);

    public final int level;

    Isolation(int level) {
        this.level = level;
    }

}
